/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.bradley.principals.core.ocp.obey;

/**
 *
 * @author Balla
 */
public class LoanRequestHandler {
    private int balance;
    private int period;

    /**
     * Creates a new instance of LoanRequestHandler
     */
    public LoanRequestHandler(int balance, int period) {
        this.balance = balance;
        this.period = period;
    }

    public void approveLoan(Validator validator) {
        if (validator.isValid(balance)) //sanction the loan
        {
            System.out.println("Loan approved...");
        } else {
            System.out.println("Sorry not enough balance...");
        }
    }
}
